<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ subject }} - 来自 {{ sender_name }}</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f4f4f4;
        }
        .container {
            background-color: #ffffff;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .header {
            border-bottom: 2px solid #28a745;
            padding-bottom: 20px;
            margin-bottom: 30px;
        }
        .platform-name {
            font-size: 18px;
            color: #28a745;
            font-weight: bold;
            margin-bottom: 10px;
        }
        .message-title {
            color: #2c3e50;
            font-size: 22px;
            margin: 0;
        }
        .sender-info {
            background-color: #e8f5e8;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 25px;
            border-left: 4px solid #28a745;
        }
        .sender-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #28a745;
            color: white;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 18px;
            margin-right: 15px;
            vertical-align: middle;
        }
        .sender-details {
            display: inline-block;
            vertical-align: middle;
        }
        .sender-name {
            font-weight: bold;
            color: #2c3e50;
            font-size: 16px;
        }
        .sender-email {
            color: #666;
            font-size: 14px;
        }
        .message-content {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            margin: 20px 0;
            border: 1px solid #e9ecef;
        }
        .message-text {
            white-space: pre-wrap;
            word-wrap: break-word;
            line-height: 1.7;
        }
        .action-buttons {
            text-align: center;
            margin: 30px 0;
        }
        .button {
            display: inline-block;
            padding: 12px 25px;
            margin: 0 10px;
            text-decoration: none;
            border-radius: 5px;
            font-weight: bold;
            font-size: 14px;
        }
        .button-primary {
            background-color: #28a745;
            color: white;
        }
        .button-secondary {
            background-color: #6c757d;
            color: white;
        }
        .footer {
            text-align: center;
            color: #666;
            font-size: 14px;
            border-top: 1px solid #eee;
            padding-top: 20px;
            margin-top: 30px;
        }
        .timestamp {
            color: #999;
            font-size: 12px;
            text-align: right;
            margin-top: 15px;
        }
        .warning {
            background-color: #fff3cd;
            border: 1px solid #ffeaa7;
            color: #856404;
            padding: 10px;
            border-radius: 5px;
            margin: 15px 0;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="platform-name">📧 {{ platform_name }} - 用户消息</div>
            <h1 class="message-title">{{ subject }}</h1>
        </div>
        
        <div class="sender-info">
            <div class="sender-avatar">{{ sender_name[0].upper() if sender_name else 'U' }}</div>
            <div class="sender-details">
                <div class="sender-name">{{ sender_name }}</div>
                <div class="sender-email">{{ sender_email }}</div>
            </div>
        </div>
        
        <div>
            <p>亲爱的 <strong>{{ recipient_name }}</strong>，</p>
            <p>您收到了一条来自 <strong>{{ sender_name }}</strong> 的消息：</p>
        </div>
        
        <div class="message-content">
            <div class="message-text">{{ message }}</div>
            <div class="timestamp">发送时间：{{ sent_time or "刚刚" }}</div>
        </div>
        
        <div class="action-buttons">
            <a href="{{ platform_url }}/messages/reply?sender={{ sender_email }}&subject={{ subject }}" class="button button-primary">
                💬 回复消息
            </a>
            <a href="{{ platform_url }}/messages" class="button button-secondary">
                📬 查看所有消息
            </a>
        </div>
        
        <div class="warning">
            <strong>⚠️ 安全提醒：</strong>
            <ul style="margin: 5px 0; padding-left: 20px;">
                <li>请勿在回复中透露个人敏感信息（如密码、身份证号等）</li>
                <li>如果消息内容可疑，请及时举报</li>
                <li>建议通过平台内消息系统进行沟通</li>
            </ul>
        </div>
        
        <div class="footer">
            <p>此邮件由 {{ platform_name }} 用户消息系统发送。</p>
            <p>如不希望接收此类邮件，可在 <a href="{{ platform_url }}/settings/notifications">通知设置</a> 中关闭邮件通知。</p>
            <p>如有疑问，请访问 <a href="{{ help_url }}">帮助中心</a> 或联系客服。</p>
            <p>&copy; 2024 {{ platform_name }}. All rights reserved.</p>
        </div>
    </div>
</body>
</html>